<%@include file="header.jsp"%>
<label name=previous><b>Reviewed Booking</b></label>
<table class="table table-striped">

<tr>
<th>#</th>
		<th><fmt:message key="label.booking.bookingID" /></th>
		<th><fmt:message key="label.facility.name" /></th>
		<th><fmt:message key="label.booking.startDate" /></th>
		<th><fmt:message key="label.booking.period" /></th>
		<th><fmt:message key="label.booking.status" /></th>
		<th><fmt:message key="label.booking.cancel" /></th>
		<th><fmt:message key="label.booking.details" /></th>
		
		<c:forEach var="booking" items="${bookinglist}" varStatus ="status"> 
		<tr>
			<td>${status.index + 1}</td>
			<td>${booking.bookingID}</td>
			<td>${booking.facilityName}</td>
			<td>${booking.startDate}</td>
			<td>${booking.period}</td>
			<td>${booking.status}</td>
			<td>
			<c:if test="${booking.status == 'approved'}">
				<c:url var="cancelurl" scope="page" value="/CancelBooking">
			<c:param name="bookingID" value="${booking.bookingID}"/>
			</c:url>
			<a href="${cancelurl}"><fmt:message key="label.booking.cancel" /></a>
			</c:if>
			</td>
			<td><c:url var="detailurl" scope="page" value="/BookingDetails">
					<c:param name="bookingID" value="${booking.bookingID }" />
					<c:param name="user" value="true" />
				</c:url> 
				<a href="${detailurl}"><fmt:message key="label.booking.details" /></a>
			</td>
</tr>
</c:forEach>
</table>

<label name=unreviewed><b>Unreviewed Booking</b> </label>
<table class="table table-striped">

<tr>
<th>#</th>
		<th><fmt:message key="label.booking.bookingID" /></th>
		<th><fmt:message key="label.facility.name" /></th>
		<th><fmt:message key="label.booking.startDate" /></th>
		<th><fmt:message key="label.booking.period" /></th>
		<th><fmt:message key="label.booking.status" /></th>
		<th>Action</th>
		
		<c:forEach var="book" items="${bookuser}" varStatus ="status"> 
			<tr>
				<td>${status.index + 1}</td>
				<td>${book.bookingID}</td>
				<td>${book.facilityName}</td>
				<td>${book.startDate}</td>
				<td>${book.period}</td>
				<td>${book.status}</td>
				<td>
					<c:url var="detailurl" scope="page" value="/BookingDetails">
						<c:param name="bookingID" value="${book.bookingID }" />
						<c:param name="user" value="true" />
					</c:url> 
					<c:url var="updateurl" scope="page" value="/Priority">
					<c:param name="bookingID" value="${book.bookingID }" />
					<c:param name="user" value ="maybe"/>
					<c:param name="checkpriority" value="false"/>
                	</c:url>
                	<c:url var="deleteurl" scope="page" value="/DeleteBooking">
					<c:param name="bookingID" value="${book.bookingID}"/>
					</c:url>
					<div class="btn-group">
					  <button class="btn btn-primary">Action</button>
					  <button class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
					    <span class="caret"></span>
					  </button>
					  <ul class="dropdown-menu">
					  	<li><a href="${detailurl}"><fmt:message key="label.booking.details" /></a></li>
					    <li><a href="${updateurl}"><fmt:message key="label.booking.update" /></a></li>
					    <li><a href="${deleteurl}"><fmt:message key="label.booking.delete" /></a></li>
					  </ul>
					</div>
				</td>
			</tr>
		</c:forEach>
</table>

<%@include file="footer.jsp"%>